<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SQL设置</title>
<script src="js/SQLSet.js"></script>
<style>
label {
	display: inline-block;
	color: #00A;
	padding-left: 3px;
}

input.fill {
	width: 97%;
	color: #00A;
}

select {
	color: #00A;
}

input.readonly {
	background-color: transparent;
	border-left: 0px;
	width: 97%;
	border-top: 0px;
	border-right: 0px;
	border-bottom: 0px;
	padding-left: 3px;
	color: #00A;
}

table,td {
	font: 14px Arial, Helvetica, sans-serif;
	height: 25px;
}

#gridTable table {
	border-collapse: collapse;
	margin: 1em 0;
}

#gridTable td {
	text-align: left;
	padding: .2em;
	border: 1px solid #999;
}
</style>
</head>
<body>
	<div style="padding: 5px 0px 0px 10px;">
		<input type="button" value="查询" onclick="querySQLSet()" />&nbsp;&nbsp;
		<input type="button" value="新增" onclick="addSQLSet()" />
		<div id="gridTable">
			<table>
				<tr>
					<td width="40px"><b>序号</b></td>
					<td width="150px"><b>名称</b></td>
					<td width="300px"><b>描述</b></td>
					<td><b>操作</b></td>
				</tr>
				<tr style="display: none;">
					<td><a name="gridIndex"></a></td>
					<td><input name="grid_name" readonly="readonly"
						style="border: 0 0 0 0;" /></td>
					<td><input name="grid_description" readonly="readonly"
						style="border: 0 0 0 0;" /></td>
					<td><input type="button" value="修改"
						onclick="changeSQLSet(this)" /><input type="button" value="删除"
						onclick="delSQLSet(this)" /></td>
				</tr>
			</table>
		</div>
		<div id="showSQL" style="display: none;">
			<table>
				<tr>
					<td>名称：</td>
					<td><input name="name" style="width: 600px" /></td>
				</tr>
				<tr>
					<td>描述：</td>
					<td><input name="description" style="width: 600px" /></td>
				</tr>
				<tr>
					<td>数据库：</td>
					<td><select name="database">
							<option value="0">OA</option>
							<option value="1">HR</option>
							<option value="2">UAP</option>
							<option value="3">ERP</option>
					</select></td>
				</tr>
				<tr>
					<td valign="top">SQL语句<a name="sqlIndex">1</a>：
					</td>
					<td><textarea name="sql" style="width: 600px; height: 100px;"></textarea></td>
					<td valign="bottom"><input type="button" value="增加"
						onclick="addSQLTR(this)" /><input type="button" value="删除"
						onclick="delSQLTR(this)" /></td>
				</tr>
				<tr id="errorTR">
					<td>异常反馈：</td>
					<td><input name="errorMsg" style="width: 600px" /></td>
				</tr>
				<tr>
					<td>结果为空反馈：</td>
					<td><textarea name="nullMsg" style="width: 600px" ></textarea></td>
				</tr>
				<tr>
					<td>字段列表：</td>
					<td><input name="fieldName" style="width: 600px" /></td>
				</tr>
				<tr>
					<td></td>
					<td style="color: red;width: 600px;">备注:<br />1、字段列表用于置空列表字段，格式为{comm:['字段名'],repeat:[['字段名']],setNull:['需要置空的字段名']}
						<br/>2、如果查询字段为重复表字段，SQL语句使用instr('§€'||'重复表字段的值'||'§€','§€'||数据库字段||'§€')<>0。另外结果增加字段“重复表字段  as queryFieldName”
						<br/>3、如果某一个字段为控件，SQL语句要将字段值和字段ID合并成JSON字符串组，例：'["'||m.name||'","'||field0008||'"]'
					</td>
				</tr>
				<tr>
					<td></td>
					<td align="right"><input type="button" value="保存"
						onclick="save()" /><input type="button" value="返回"
						onclick="returnButtonClick()" /></td>
				</tr>
			</table>
		</div>
	</div>
	<div id='lodingDiv'
		style='display: none; filter: alpha(opacity =                         30); opacity: 0.3; z-index: 12001; text-align: center; position: absolute; width: 100%; height: 600px; background: url("./myCommonJS/img/loding.gif") no-repeat center center #666; left: 0; top: 0;'>
		&nbsp;</div>
</body>
</html>